<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title></title>
<#include "/jspgou_sys/head.html"/>
<script type="text/javascript">
$(function() {
	methodChange();
	$("#jvForm").validate();
});
function methodChange() {
var method = $("input[name=method]:checked").val();
if(method=="1") {
	$('#uniformDiv').show();
	$('#weightDiv').hide();
}else if(method=="2") {
	$('#uniformDiv').hide();
	$('#weightDiv').show();
}else if(method=="3") {
	$('#uniformDiv').hide();
	$('#weightDiv').show();
}
return true;
}
var index=1;
function appendLine() {
	var s = $.format($('#tpl').val(),index);
	index++;
	$('#cps').append(s);
}
</script>
<style type="text/css">
.method-div{padding:2px 1px;}
.hidden{display:none;}
.country-price{border:1px solid #ccc;padding:2px;margin:2px 0px;}
</style>
</head>
<body>
<textarea id="tpl" style="display:none">
	<div id="cp{0}" class="country-price">

		<div><@s.m "shipping.firstPrice"/>: <input type="text" name="firstPrice{0}" vld="{required:function(){var m=$('input[name=method]:checked').val(); return m=='3';},number:true,maxlength:20}" size="7"/> &nbsp; &nbsp; <@s.m "shipping.additionalPrice"/>: <input type="text" name="additionalPrice{0}" vld="{required:function(){var m=$('input[name=method]:checked').val(); return m=='3';},number:true,maxlength:20}" size="7"/> &nbsp; <input type="button" value="<@s.m "shipping.deleteLine"/>" onclick="$('#cp{0}').remove();"/></div>
	</div>
</textarea>
<div class="body-box">
<div class="rhead">
	<div class="rpos"><@s.m "global.position"/>: <@s.m "shipping.function"/> - <@s.m "global.add"/></div>
	<form class="ropt">
		<input type="submit" value="<@s.m "global.backToList"/>" onclick="this.form.action='v_list.do';"/>
	</form>
	<div class="clear"></div>
</div>
<@p.form id="jvForm" action="o_save.do">
<@p.text label="shipping.name" name="name" required="true" class="required" size="40" maxlength="150"/>
<@p.select  label="物流公司" name="logisticsId"  list=list listKey="id" listValue="name" required="true"/>
<@p.select  label="物流类型" name="logisticsType" required="true" list={"EXPRESS":"快递","POST":"平邮","EMS":"EMS"} />

<@p.td label="shipping.method" required="true">
<@p.radio name="method" required="true" value="1" list={"1":"shipping.uniformPrice","2":"shipping.byWeight"} onclick="methodChange();"/>
<div id="uniformDiv" class="method-div hidden"><@s.m "shipping.uniformPrice"/>: <input type="text" name="uniformPrice" vld="{required:function(){var m=$('input[name=method]:checked').val(); return m=='1';},number:true,maxlength:20}"/></div>
<div id="weightDiv" class="hidden">
	<div class="method-div"><@s.m "shipping.firstWeight"/>: <input type="text" name="firstWeight" vld="{required:function(){var m=$('input[name=method]:checked').val(); return m=='2'||m=='3';},digits:true,maxlength:10}" size="7"/> g &nbsp; <@s.m "shipping.additionalWeight"/>: <input type="text" name="additionalWeight" vld="{required:function(){var m=$('input[name=method]:checked').val(); return m=='2'||m=='3';},digits:true,maxlength:10}" size="7"/> g</div>
	<div class="method-div"><@s.m "shipping.firstPrice"/>: <input type="text" name="firstPrice" vld="{required:function(){var m=$('input[name=method]:checked').val(); return m=='2'||m=='3';},number:true,maxlength:20}" size="7"/> &nbsp; &nbsp; <@s.m "shipping.additionalPrice"/>: <input type="text" name="additionalPrice" vld="{required:function(){var m=$('input[name=method]:checked').val(); return m=='2'||m=='3';},number:true,maxlength:20}" size="7"/></div>
</div>
</@p.td><@p.tr/>
<@p.text label="shipping.priority" name="priority" required="true" value="10" class="required digits" size="7" maxlength="10"/>
<@p.radio label="shipping.disabled" name="disabled" required="true" value="false" list={"false":"global.true","true":"global.false"}/>
<@p.radio label="是否默认" name="isDefault" list={"true":"global.true","false":"global.false"} value="false" required="true" class="required"/>
<@p.textarea label="shipping.description" name="description" cols="70" rows="3" maxlength="255"/>
<@p.td><@p.submit code="global.submit"/> &nbsp; <@p.reset code="global.reset"/></@p.td>
</@p.form>
</div>
</body>
</html>